Skip to content

OrthoBoSampler Implementation#375

Open
Galvanized-Heart wants to merge 6 commits into
optuna:mainfrom
Galvanized-Heart:main
Open

OrthoBoSampler Implementation#375
Galvanized-Heart wants to merge 6 commits into
optuna:mainfrom
Galvanized-Heart:main

Conversation

@Galvanized-Heart
Copy link
Copy Markdown

Contributor Agreements

Please read the contributor agreements and if you agree, please click the checkbox below.

  • I agree to the contributor agreements.

Tip

Please follow the Quick TODO list to smoothly merge your PR.

Motivation

The Optuna ecosystem lacks a sampler that utilizes orthogonalized Bayesian optimization (OrthoBO), addressing issue #374. This technique applies an orthogonal score function control variate for variance reduction over the hyperposterior, leading to improved convergence and stability in hyperparameter optimization compared to naive marginalization.

Description of the changes

  • Added OrthoBoSampler under package/samplers/orthobo/ with optional orthonalization.
  • Uses botorch and gpytorch to extract hyperparameters and calculate the diagonal Laplace approximation for the hyperposterior.
  • Implements an Orthogonalized Log Expected Improvement (_OrthogonalLogEI) acquisition function.
  • Includes an example script (example.py) demonstrating usage on the Hartmann6 benchmark.

TODO List towards PR Merge

Please remove this section if this PR is not an addition of a new package.
Otherwise, please check the following TODO list:

  • Copy ./template/ to create your package
  • Replace <COPYRIGHT HOLDER> in LICENSE of your package with your name
  • Fill out README.md in your package
  • Add import statements of your function or class names to be used in __init__.py
  • (Optional) Add from __future__ import annotations at the head of any Python files that include typing to support older Python versions
  • Apply the formatter based on the tips in README.md
  • Check whether your module works as intended based on the tips in README.md

@c-bata
Copy link
Copy Markdown
Member

c-bata commented May 20, 2026

@kAIto47802 Could you review this PR?

Comment thread package/samplers/orthobo/README.md Outdated
Co-authored-by: Kaito Baba <115693559+kAIto47802@users.noreply.github.com>
@Galvanized-Heart
Copy link
Copy Markdown
Author

Were there any other things you noticed were necessary updates for the PR?

@kAIto47802
Copy link
Copy Markdown
Collaborator

kAIto47802 commented May 29, 2026

Thank you for the update.
Could you please slightly minimize the size of the images? It is highly recommended that images be kept small in file size, with a practical guideline being 100KB per package, as described in the document for the registration.

The current total image size is about 211KB, and you can minimize it by the following commands:

$stat -c '%n %s' package/samplers/orthobo/images/*.png | numfmt --field=2 --to=si --suffix=B
package/samplers/orthobo/images/Hartmann6.png  98kB
package/samplers/orthobo/images/Levy16.png  113kB
$pngquant --quality=70-90 --strip --force --ext .png package/samplers/orthobo/images/Hartmann6.png
$pngquant --quality=70-90 --strip --force --ext .png package/samplers/orthobo/images/Levy16.png
$stat -c '%n %s' package/samplers/orthobo/images/*.png | numfmt --field=2 --to=si --suffix=B
package/samplers/orthobo/images/Hartmann6.png  27kB
package/samplers/orthobo/images/Levy16.png  31kB

Except for this point, it almost LGTM, and I think we can merge this PR once you address this point. We sincerely appreciate your contribution!

@Galvanized-Heart
Copy link
Copy Markdown
Author

I got the image sizes down to

$ stat -c '%n %s' package/samplers/orthobo/images/*.png | numfmt --field=2 --to=si --suffix=B
package/samplers/orthobo/images/Hartmann6.png  28KB
package/samplers/orthobo/images/Levy16.png  33KB

And formatted them to be 600px wide in the README.md.

Hope that works for everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants